import { Column, Entity, Index } from "typeorm";
import { DeletedEntity } from "./base/deleted.entity";

@Index("sys_dept_type_pkey", ["id"], { unique: true })
@Index("sys_dept_type_name_not_deleted_ukey", ["name"], { unique: true })
@Entity("sys_dept_type", { schema: "public" })
export class SysDeptType extends DeletedEntity {
    @Column("bigint", { primary: true, name: "id" })
    id!: string;

    @Column("character varying", { name: "name", length: 32 })
    name!: string;

    @Column("character varying", { name: "icon", nullable: true, length: 64 })
    icon!: string | null;

    @Column("character varying", { name: "remark", nullable: true, length: 256 })
    remark!: string | null;

    @Column("int4", {
        name: "cascade_level",
        array: true,
        default: () => "ARRAY[]::integer[]",
    })
    cascadeLevel!: number[];
}
